/**
 *
 * description:Object Util
 * create by mirko
 * 1061773869@qq.com
 *
 */

function objectSort(object) {
    if (!(object instanceof Object)) {
        throw new Error(`${object} must be an object`)
    }
    let keys = Object.keys(object);
    let tempKey = keys.sort();
    let temp_obj = {};
    tempKey.forEach(value => {
        temp_obj[value] = object[value]
    });
    return temp_obj
}

module.exports.objectSort = objectSort
